﻿using System.Windows;
using System.Windows.Controls;
using LiveTiss.Schemas;
using LiveTiss.Classes;

namespace LiveTiss.Guias.UserControls
{
    public partial class CabecalhoGuia : UserControl
    {
        #region Value

        public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value",
            typeof(ct_cabecalhoGuia), typeof(CabecalhoGuia), new PropertyMetadata(null));

        public ct_cabecalhoGuia Value
        {
            get { return (ct_cabecalhoGuia)GetValue(ValueProperty); }
            set { SetValue(ValueProperty, value); }
        }

        #endregion

        #region Titulo Guia

        public string TituloGuia
        {
            get { return (string)GetValue(TituloGuiaProperty); }
            set { SetValue(TituloGuiaProperty, value); }
        }

        public static readonly DependencyProperty TituloGuiaProperty =
            DependencyProperty.Register("TituloGuia", typeof(string), typeof(CabecalhoGuia), new PropertyMetadata(null));

        #endregion

        public CabecalhoGuia()
        {
            this.DataContext = this;

            this.TituloGuia = string.Empty;
            if (this.Value == null)
            {
                this.Value = new ct_cabecalhoGuia()
                {
                    numeroGuiaOperadora = string.Empty,
                    numeroGuiaPrestador = string.Empty,
                    dataEmissaoGuia = Util.EmptyDate,
                    identificacaoFontePagadora = new ct_cabecalhoGuiaIdentificacaoFontePagadora()
                    {
                        ItemValue = string.Empty,
                        ItemElementName = ItemChoiceType1.cnpjFontePagadora,
                    }
                };
            }

            InitializeComponent();
        }
    }
}
